Interacting using the command line

Nina Norgren

Commands to cover

Mkdir (no blanks) Cp Mv Less Head/tail Nano? Rm rmdir * grep Touch?

Interaction commands

  • mkdir - make directory
    • Create new folder from current position

Interaction commands

  • rmdir - remove empty directory
    • Remove empty folder

Interaction commands

  • cp - copy a file
cp <name of original> <name of copy>

Interaction commands

  • cp - copy a file
cp <name of original> <name of copy>


Never use blanks in your folder/file names!

Interaction commands

  • cp - copy a file
cp <name of original> <name of copy>
cp copied_file analysis/

Interaction commands

  • cp - copy a file
cp <name of original> <name of copy>
cd analysis/
cp copied_file ../data/raw_data

Interaction commands

  • cp - copy a file

Linux never asks before overwriting existing files!

Interaction commands

  • mv - move a file
mv <name of the file> <name of the “copy”>
mv ../copied_file .


Notice! the . denotes the current location

Interaction commands

  • mv - rename a file
mv <name of the file> <name of the “copy”>
mv copied_file my_renamed_file

Interaction commands

  • rm - remove a file
rm <name of the file>
rm copied_file

Interaction commands

  • rm - remove a file
rm <name of the file>
rm ../original_file

Interaction commands

  • rm - remove a file
rm <name of the file>


There is NO trash bin in CLI! Gone is gone!

Interaction commands

  • * - wildcards
    • Works on most linux commands
ls -l *.txt

Interaction commands

  • * - wildcards
    • Works on most linux commands
cp *.txt myfolder/
rm *.txt